package test;

public class Student {
    private String name;
    private int age;
    private String gender;

    public Student() {
    }

    public Student(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }
    public int hashCode(){
        return this.name.hashCode();
    }
    public boolean equals(Object obj){
        Student stu = (Student)obj;
        if(this.name.equals(stu.getName())){
            return true;
        }
        return false;
    }
    public String toString(){
        return this.name + ","+this.age + ","+this.gender;
    }

    public  void intro(){
        System.out.println("你好，我叫"+this.name+",今年"+this.age+"岁");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
}
